import request from "@/utils/axios";
// 获取角色列表
const getRoleList = query => {
  return request.post("/accountApi/getRoleList", query);
};
// 获取所有菜单
const getPermissions = query => {
  return request.post("/systemMenu/getMenuList", query);
};
// 获取一级菜单
const queryParentsNav = query => {
  return request.post("/permissionApi/queryParents", query);
};
// 菜单新增
const permissionAdd = query => {
  return request.post("/systemMenu/add", query);
};
// 菜单修改
const permissionUpdate = query => {
  return request.post("/systemMenu/edit", query);
};
// 菜单删除
const permissionDelete = query => {
  return request.post("/systemMenu/delete", query);
};
// 绑定角色与资源
const addDutyNavBinding = query => {
  return request.post("/permissionBindApi/addDutyNavBinding", query);
};
// 获取某角色的资源 //可删除
const getDutyNavBinding = query => {
  return request.post("/permissionBindApi/getData", query);
};
// 获取管理员列表
const getAccountList = query => {
  return request.post("/accountApi/getAccountList", query);
};

export default {
  getRoleList,
  getPermissions,
  queryParentsNav,
  permissionAdd,
  permissionUpdate,
  permissionDelete,
  addDutyNavBinding,
  getDutyNavBinding,
  getAccountList
};
